package com.easondongh.business.service;

import com.easondongh.business.domain.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
import com.easondongh.business.domain.Customer;
import com.easondongh.business.vo.CustomerQueryVo;
import com.easondongh.business.vo.GoodsQueryVo;
import com.easondongh.common.vo.BasePageQueryVo;
import com.easondongh.common.vo.PageResult;

import java.util.List;

/**
 * @author EasonDongH
 * @date 2020/6/1 10:51
 */
public interface GoodsService extends IService<Goods>{

    /**
     * 根据查询条件分页查询商品
     * @param queryCondition
     * @return
     */
    PageResult<Goods> getByPage(BasePageQueryVo<GoodsQueryVo> queryCondition);

    /**
     * 启用该商品
     * @param id
     * @return
     */
    boolean enableById(Integer id);

    /**
     * 弃用该商品
     * @param id
     * @return
     */
    boolean disableById(Integer id);

    /**
     * 获取所有启用中的商品
     * @return
     */
    List<Goods> getAllEnableGoods();

    /**
     * 更新库存
     * @param goodsId
     * @param num
     * @return
     */
    boolean updateStock(Integer goodsId, int num);
}
